package pers.qianyu.module.system.exception;

import pers.qianyu.exception.*;

public enum SysErrorCodeEnum implements ILambErrorCodeEnum {
    AUTHENTICATE_FAILED(2300, "认证失败"),
    NO_LOGIN(2301, "当前操作需要登录，请登陆后重试"),
    CODE_EXPIRED_OR_ERROR(2302, "验证码错误或已失效"),
    CODE_ERROR(2303, "验证码不正确"),
    ACCOUNT_NOT_FOUND(2304, "账号不存在"),
    ACCOUNT_IS_LOCKED(2305, "账号已被锁定,请联系管理员"),
    USERNAME_OR_PASSWORD_ERROR(2306, "用户名或密码错误"),
    TOKEN_EXPIRED(2307, "您长时间未操作，请重新登录"),
    INVALID_TOKEN(2308, "非法token"),
    TOKEN_IS_EMPTY(2309, "token 不能为空"),
    INVALID_ROLE_ID(2310, "非法角色 ID"),
    INVALID_PARAMETERS(2311, "参数不正确"),
    INVALID_PERMISSION_ID(2312, "非法权限 ID"),
    SYS_USER_NOT_FOUND(2313, "找不到用户信息"),
    INVALID_SYS_USER_ID(2314, "非法用户 ID"),
    INVALID_SYS_ROLE_ID(2315, "非法角色 ID"),
    USERNAME_ALREADY_EXISTS(2316, "用户名已经存在"),
    ROLE_NAME_ALREADY_EXISTS(2317, "角色名已经存在"),
    ROLE_KEY_ALREADY_EXISTS(2318, "角色关键字已经存在"),
    INVALID_USERNAME(2319, "不能使用该用户名进行注册"),
    REPEATED_USERNAME(2320, "用户名已存在，更换用户名"),
    INVALID_RESOURCE_ID(2321, "非法权限 ID"),
    REPEATED_ROLE_KEY(2321,"角色key出现重复"),
    ;

    @Override
    public String getMessage() {
        return message;
    }

    @Override
    public Integer getCode() {
        return code;
    }

    private final Integer code;
    private final String message;

    SysErrorCodeEnum(Integer code, String message) {
        this.message = message;
        this.code = code;
    }
}
